import axios from 'axios';
import {API_NEW_VERSION} from '../api';

// 路径  start

const SIGN_OFFS = API_NEW_VERSION + 'sign_offs';

const SPECIAL_RECEIPTS = API_NEW_VERSION + 'special_receipts';

const SIGN_OFF_FIND_BY_SING_OFF_ID = API_NEW_VERSION + 'sign_off_pictures_find_by_sing_off_id/';

const SIGN_OFF_WAIT_RETURN = API_NEW_VERSION + 'sign_off_wait_return';

const SIGN_OFF_WAIT_RETURN_ALREADY_RETURN = API_NEW_VERSION + 'sign_off_wait_return_already_return';

const SIGN_OFF_ABNORMAL_NOT_NULL = API_NEW_VERSION + 'sign_off_abnormal_not_null';

const SPECIAL_RECEIPT_BY_SIGN_OFF_ID = API_NEW_VERSION + 'special_receipt_by_sign_off_id';

// 获取签收任务列表
export const searchSignOffs = params => {
  return axios.get(SIGN_OFFS, {params: params});
};
// 获取 未返还 签收任务列表
export const searchSignOffByWaitReturn = params => {
  return axios.get(SIGN_OFF_WAIT_RETURN, {params: params});
};

// 获取已返还签收任务列表
export const searchAlreadAndWaitDate = params => {
  return axios.get(SIGN_OFF_WAIT_RETURN_ALREADY_RETURN, {params: params});
};

// 保存专线回单
export const saveSpecialReceipt = (params) => {
  return axios.post(SPECIAL_RECEIPTS, params);
};

// 根据ID，获取签收 图片 详情
export const getSignOffPicture = id => {
  return axios.get(SIGN_OFF_FIND_BY_SING_OFF_ID, {params: {id: id}});
};

// 根据ID，获取异常回单列表
export const getSpecialReceiptBySignOffId = id => {
  return axios.get(SPECIAL_RECEIPT_BY_SIGN_OFF_ID, {params: {signOffId: id}});
};

// 搜索异常回单
export const searchAbnormalDate = params => {
  return axios.get(SIGN_OFF_ABNORMAL_NOT_NULL, {params: params});
};
